/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Cristian
 */
@Entity
@Table(name = "sctptbperiodo")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Sctptbperiodo.findAll", query = "SELECT s FROM Sctptbperiodo s"),
    @NamedQuery(name = "Sctptbperiodo.findBySctptbperiodoid", query = "SELECT s FROM Sctptbperiodo s WHERE s.sctptbperiodoid = :sctptbperiodoid"),
    @NamedQuery(name = "Sctptbperiodo.findByYearperiodo", query = "SELECT s FROM Sctptbperiodo s WHERE s.yearperiodo = :yearperiodo"),
    @NamedQuery(name = "Sctptbperiodo.findByObservaciones", query = "SELECT s FROM Sctptbperiodo s WHERE s.observaciones = :observaciones")})
public class Sctptbperiodo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "sctptbperiodoid")
    private Integer sctptbperiodoid;
    @Basic(optional = false)
    @NotNull
    @Column(name = "yearperiodo")
    private int yearperiodo;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(name = "observaciones")
    private String observaciones;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "sctptbperiodoid")
    private Collection<Sciftbinftecn> sciftbinftecnCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "sctptbperiodoid")
    private Collection<Sciftbinfdoc> sciftbinfdocCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "sctptbperiodoid")
    private Collection<Sciftbplandoc> sciftbplandocCollection;

    public Sctptbperiodo() {
    }

    public Sctptbperiodo(Integer sctptbperiodoid) {
        this.sctptbperiodoid = sctptbperiodoid;
    }

    public Sctptbperiodo(Integer sctptbperiodoid, int yearperiodo, String observaciones) {
        this.sctptbperiodoid = sctptbperiodoid;
        this.yearperiodo = yearperiodo;
        this.observaciones = observaciones;
    }

    public Integer getSctptbperiodoid() {
        return sctptbperiodoid;
    }

    public void setSctptbperiodoid(Integer sctptbperiodoid) {
        this.sctptbperiodoid = sctptbperiodoid;
    }

    public int getYearperiodo() {
        return yearperiodo;
    }

    public void setYearperiodo(int yearperiodo) {
        this.yearperiodo = yearperiodo;
    }

    public String getObservaciones() {
        return observaciones;
    }

    public void setObservaciones(String observaciones) {
        this.observaciones = observaciones;
    }

    @XmlTransient
    public Collection<Sciftbinftecn> getSciftbinftecnCollection() {
        return sciftbinftecnCollection;
    }

    public void setSciftbinftecnCollection(Collection<Sciftbinftecn> sciftbinftecnCollection) {
        this.sciftbinftecnCollection = sciftbinftecnCollection;
    }

    @XmlTransient
    public Collection<Sciftbinfdoc> getSciftbinfdocCollection() {
        return sciftbinfdocCollection;
    }

    public void setSciftbinfdocCollection(Collection<Sciftbinfdoc> sciftbinfdocCollection) {
        this.sciftbinfdocCollection = sciftbinfdocCollection;
    }

    @XmlTransient
    public Collection<Sciftbplandoc> getSciftbplandocCollection() {
        return sciftbplandocCollection;
    }

    public void setSciftbplandocCollection(Collection<Sciftbplandoc> sciftbplandocCollection) {
        this.sciftbplandocCollection = sciftbplandocCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (sctptbperiodoid != null ? sctptbperiodoid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Sctptbperiodo)) {
            return false;
        }
        Sctptbperiodo other = (Sctptbperiodo) object;
        if ((this.sctptbperiodoid == null && other.sctptbperiodoid != null) || (this.sctptbperiodoid != null && !this.sctptbperiodoid.equals(other.sctptbperiodoid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Sctptbperiodo[ sctptbperiodoid=" + sctptbperiodoid + " ]";
    }
    
}
